Skip to content

Conversation

tscni
Copy link
Contributor

@tscni tscni commented Jan 13, 2025

For some reason #1280 changed the return type of Generator::current() from TYield|null to TYield, which is not correct.
Similarly, Generator::key() can return null as well.

For reference: https://3v4l.org/aSMe8

$generator = (function () {
    yield 0;
})();

var_dump($generator->current()); // 0
var_dump($generator->key()); // 0

$generator->next();

var_dump($generator->current()); // null
var_dump($generator->key()); // null

@isfedorov isfedorov merged commit 991fd13 into JetBrains:master Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants